<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form action="http://localhost:3000/register" method="post">
        <input type="text" name="username">
        <br>
        <input type="password" name="password">
        <br>
        <input type="password" name="password2">
        <br>
        <input type="text" name="yzm">
        <img src="http://localhost:3000/code?id=1" alt="">
        <br>
        <input type="submit" value="登录">
    </form>
    <script>
        let img = document.querySelector('img');
        img.onclick = function () {
            let time = +new Date();
            this.src = 'http://localhost:3000/code?id=' + time;
        }
    </script>
</body>

</html>